<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no">
		<title>修改管理员</title>
		<link rel="stylesheet" href="/static/web/css/font-awesome.min.css">
		<link rel="stylesheet" href="/static/web/css/bootstrap.min.css">
		<link rel="stylesheet" href="/static/web/css/admin.css">
	</head>
	<body>
		<form name="form1" action="sys_admin_user_edit.php" method="post">
			<input type="hidden" name="dopost" value="saveedit">
			<input type="hidden" name="_csrf_token" value="<?php echo $GLOBALS['csrf_token'];?>">
			<input type="hidden" name="id" value="<?php echo $row['id']?>">
			<input type="hidden" name="olduserid" value="<?php echo $row['userid']?>">
			<table class="table shadow-sm my-3">
				<tr>
					<td colspan="2">修改管理员</td>
				</tr>
				<tr>
					<td width="260">账号：</td>
					<td><input type="text" name="userid" id="userid" value="<?php echo $row['userid']?>" class="admin-input-sm"></td>
				</tr>
				<tr>
					<td>昵称：</td>
					<td>
						<input type="text" name="uname" id="uname" value="<?php echo $row['uname']?>" class="admin-input-sm">
						<span>（发布文档后显示作者的名字）</span>
					</td>
				</tr>
				<tr>
					<td>密码：</td>
					<td>
						<input type="text" name="pwd" id="pwd" class="admin-input-sm">
						<span>（留空则不修改，请使用数字0-9小写a-z大写A-Z符号_@!.-）</span>
					</td>
				</tr>
				<tr>
					<td>类型：</td>
					<td>
						<select name="usertype" class="admin-input-sm">
							<?php
							$dsql->SetQuery("SELECT * FROM `#@__admintype` ORDER BY `rank` ASC");
							$dsql->Execute("ut");
							while($myrow = $dsql->GetObject("ut"))
							{
								if ($row['usertype']==$myrow->rank) echo "<option value='".$myrow->rank."' selected='1'>".$myrow->typename."</option>";
								else echo "<option value='".$myrow->rank."'>".$myrow->typename."</option>";
							}
							?>
						</select>
					</td>
				</tr>
				<tr>
					<td>授权栏目：</td>
					<td>
						<select name="typeids[]" id="typeid" multiple="yes" class="admin-input-lg">
							<option value="0">所有栏目</option>
							<?php echo $typeOptions?>
						</select>
						<span>（支持多选）</span>
					</td>
				</tr>
				<tr>
					<td>姓名：</td>
					<td><input type="text" name="tname" id="tname" value="<?php echo $row['tname']?>" class="admin-input-sm"></td>
				</tr>
				<tr>
					<td>邮箱：</td>
					<td><input type="text" name="email" id="email" autocomplete="off" value="<?php echo $row['email']?>" class="admin-input-sm"></td>
				</tr>
				<tr>
					<td>验证安全码：</td>
					<td>
						<input type="text" name="safecode" id="safecode" class="admin-input-sm">
						<input type="hidden" name="randcode" value="<?php echo $randcode;?>">
						<span>（安全码：<?php echo $safecode;?>）</span>
					</td>
				</tr>
				<tr>
					<td colspan="2" align="center">
						<button type="submit" name="submit" class="btn btn-success btn-sm">保存</button>
						<button type="button" class="btn btn-outline-success btn-sm" onclick="location='sys_admin_user.php';">返回</button>
					</td>
				</tr>
			</table>
		</form>
	</body>
</html>